﻿using System.Threading.Tasks;
using System.Web.Mvc;
using ZSoftInstagram.Domain.User;
using ZSoftInstagram.Services.Abstraction;
using ZSoftInstagram.UI.Web.Infrastructure.AppEvents.BaseControllers;

namespace ZSoftInstagram.UI.Web.Controllers
{
    [Authorize]
    public class UserController : EntityController<ApplicationUser>
    {
        private IUserService _service;

        public UserController(IUserService service)
        {
            this._service = service;
        }

        protected override IEntityService<ApplicationUser> Service
        {
            get
            {
                return _service;
            }
        }
        
        public async Task<ActionResult> MyLikes()
        {
            return View(await _service.GetUserLikesAsync(this.CurrentUserId));
        }


        public ActionResult Index()
        {
            return View();
        }
    }
}